package com.leetcode.August;

/**
 * @Description: 旋转图像
 * @Author: Mr.Fxy
 * @CreateTime: 2024-08-03 09:57
 */
public class rotatImage {
    public void rotate(int[][] matrix) {
        int he = matrix.length;
        for (int i = 0; i < he/2; i++) {
            int[] temp=matrix[i];
            matrix[i]=matrix[he-i-1];
            matrix[he-i-1]=temp;
        }
        for (int i = 0; i < he; i++) {
            for (int j = i; j < he; j++) {
                int temp=matrix[i][j];
                matrix[i][j]=matrix[j][i];
                matrix[j][i]=temp;
            }
        }

    }
}
